/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_Order", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbOrder.findAll", query = "SELECT t FROM TbOrder t"),
    @NamedQuery(name = "TbOrder.findByOID", query = "SELECT t FROM TbOrder t WHERE t.oID = :oID"),
    @NamedQuery(name = "TbOrder.findByDateOn", query = "SELECT t FROM TbOrder t WHERE t.dateOn = :dateOn"),
    @NamedQuery(name = "TbOrder.findByDateOff", query = "SELECT t FROM TbOrder t WHERE t.dateOff = :dateOff"),
    @NamedQuery(name = "TbOrder.findByAmount", query = "SELECT t FROM TbOrder t WHERE t.amount = :amount"),
    @NamedQuery(name = "TbOrder.findByPrice", query = "SELECT t FROM TbOrder t WHERE t.price = :price"),
    @NamedQuery(name = "TbOrder.findByRate", query = "SELECT t FROM TbOrder t WHERE t.rate = :rate"),
    @NamedQuery(name = "TbOrder.findByDiscount", query = "SELECT t FROM TbOrder t WHERE t.discount = :discount"),
    @NamedQuery(name = "TbOrder.findByOPayment", query = "SELECT t FROM TbOrder t WHERE t.oPayment = :oPayment"),
    @NamedQuery(name = "TbOrder.findByCancelSTT", query = "SELECT t FROM TbOrder t WHERE t.cancelSTT = :cancelSTT")})
public class TbOrder implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "o_ID", nullable = false)
    private Integer oID;
    @Column(name = "dateOn")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateOn;
    @Column(name = "dateOff")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateOff;
    @Column(name = "amount", precision = 53)
    private Double amount;
    @Column(name = "price")
    private Long price;
    @Column(name = "rate", precision = 53)
    private Double rate;
    @Column(name = "discount", precision = 53)
    private Double discount;
    @Column(name = "o_Payment", precision = 53)
    private Double oPayment;
    @Column(name = "cancelSTT")
    private Integer cancelSTT;
    @JoinColumn(name = "tour_ID", referencedColumnName = "tour_ID")
    @ManyToOne
    private TbTours tourID;
    @JoinColumn(name = "cus_ID", referencedColumnName = "cus_ID")
    @ManyToOne
    private TbCustomer cusID;
    @JoinColumn(name = "car_ID", referencedColumnName = "car_ID")
    @ManyToOne
    private TbCars carID;

    public TbOrder() {
    }

    public TbOrder(Integer oID) {
        this.oID = oID;
    }

    public Integer getOID() {
        return oID;
    }

    public void setOID(Integer oID) {
        this.oID = oID;
    }

    public Date getDateOn() {
        return dateOn;
    }

    public void setDateOn(Date dateOn) {
        this.dateOn = dateOn;
    }

    public Date getDateOff() {
        return dateOff;
    }

    public void setDateOff(Date dateOff) {
        this.dateOff = dateOff;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Double getOPayment() {
        return oPayment;
    }

    public void setOPayment(Double oPayment) {
        this.oPayment = oPayment;
    }

    public Integer getCancelSTT() {
        return cancelSTT;
    }

    public void setCancelSTT(Integer cancelSTT) {
        this.cancelSTT = cancelSTT;
    }

    public TbTours getTourID() {
        return tourID;
    }

    public void setTourID(TbTours tourID) {
        this.tourID = tourID;
    }

    public TbCustomer getCusID() {
        return cusID;
    }

    public void setCusID(TbCustomer cusID) {
        this.cusID = cusID;
    }

    public TbCars getCarID() {
        return carID;
    }

    public void setCarID(TbCars carID) {
        this.carID = carID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (oID != null ? oID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbOrder)) {
            return false;
        }
        TbOrder other = (TbOrder) object;
        if ((this.oID == null && other.oID != null) || (this.oID != null && !this.oID.equals(other.oID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbOrder[oID=" + oID + "]";
    }

}
